<!DOCTYPE html>
<html>
<head>
    <title>Function Type apply() Method Example</title>
    <script type="text/javascript">
        
        function sum(num1, num2){
            return num1 + num2;
        }
        
        function callSum1(num1, num2){
            return sum.apply(this, arguments);
        }
        
        function callSum2(num1, num2){
            return sum.apply(this, [num1, num2]);
        }
        
        alert(callSum1(10,10));   //20
        alert(callSum2(10,10));   //20

    </script>
</head>
<body>

</body>
</html>